package main

import (
	"github.com/astaxie/beego"
	"github.com/sirupsen/logrus"
	_ "go-dingding/routers"
)

func main() {
	setLogLevel()
    //API文档
    if beego.BConfig.RunMode == "dev" {
    	beego.BConfig.WebConfig.DirectoryIndex = true
    	beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
    }
    beego.Run()
}

func setLogLevel() {
	logLevel, err := logrus.ParseLevel("debug")
	if err != nil {
		logLevel = logrus.InfoLevel
	}
	logrus.SetLevel(logLevel)
}

